package com.woniuxy.config;

import org.redisson.api.RBloomFilter;
import org.redisson.api.RedissonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @BelongsProject: pigTrotterStore
 * @BelongsPackage: com.woniuxy.config
 * @Author: Quan
 * @Date: 2025/3/13 8:19
 */
@Configuration
public class BloomFilterConfig {
	@Resource
	private RedissonClient client;

	@Bean
	public RBloomFilter<String> userBloomFilter() {
		RBloomFilter<String> bloomFilter = client.getBloomFilter("userBloomFilter");
		bloomFilter.tryInit(1000, 0.01);

		return bloomFilter;
	}

}
